package cn.com.api.mapper.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiU_post_img;

//DAO
public interface U_post_imgMapperBase {

	// 根据id查看
	@Select("SELECT * FROM U_POST_IMG  WHERE ID = #{id}")
	public ApiU_post_img findU_post_imgById(Integer id);

	// 查看数据集
	@Select("SELECT * FROM U_post_img")
	public List<ApiU_post_img> findU_post_imgs();

	// 根据条件查看数据集
	public List<Map<String, Object>> findU_post_imgsByMap(HashMap condition);

	// 添加
	@Insert("INSERT INTO U_POST_IMG (POST_ID, IMG, SORT) VALUES (#{post_id}, #{img}, #{sort})")
	@Options(useGeneratedKeys = true, keyProperty = "id")
	public int insertU_post_img(ApiU_post_img u_post_img);

	// 修改
	@Update("UPDATE U_POST_IMG SET POST_ID = #{post_id}, IMG = #{img}, SORT = #{sort} WHERE ID = #{id}")
	public int updateU_post_img(ApiU_post_img u_post_img);

	// 删除
	@Delete("DELETE FROM U_POST_IMG  WHERE ID = #{id}")
	public int deleteU_post_img(Integer id);

	// Foreign keys revelant

	// region Indexs revelant

}
